package org.xobo.finance.helper.base.service;

import java.util.HashMap;
import java.util.Map;

import org.malagu.panda.coke.viewgenerator.domain.EntityDef;
import org.malagu.panda.coke.viewgenerator.util.FreeMarkerUtil;
import org.malagu.panda.coke.viewgenerator.util.ViewGeneratorUtil;
import org.xobo.finance.helper.company.entity.Company;
import org.xobo.finance.helper.invoice.entity.Invoice;

public class ViewCreator {

  public static void main(String[] args) {
    EntityDef master = ViewGeneratorUtil.build(Company.class);
    EntityDef slave = ViewGeneratorUtil.build(Invoice.class);


    Map<String, Object> dataModel = new HashMap<>();
    dataModel.put("entity", slave);
    dataModel.put("master", master);
    dataModel.put("slave", slave);

    String result = FreeMarkerUtil.generate("SinglePageMaintain.java.ftl", dataModel);
    System.out.println(result);
  }

}
